var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent);
var isWechat = window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == 'micromessenger';

if(isMobile) {
    var urlM = "../m/index.shtml" + location.search;
    if(isWechat) {
        window.location.replace(urlM);
    }else {
        window.location.href = urlM;
    }
}